package com.yds.dubbo.tracing.provider.impl;

import com.yds.dubbo.tracing.api.HelloService;
import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.rpc.RpcContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author liuhongzhen
 * @date 2023/3/24 15:34
 */
@DubboService(timeout = 10000)
public class HelloServiceImpl implements HelloService {

    private static final Logger LOGGER = LoggerFactory.getLogger(HelloServiceImpl.class);

    @Override
    public String sayHi(String name) {
        LOGGER.info("Hello {}, request from consumer: {}", name, RpcContext.getContext().getRemoteAddress());
        return "Hello " + name;
    }
}
